<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <h1>Hello axios</h1>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script>
      const URL =
        "https://api.github.com/search/repositories?q=javascript&sort=stars";
      // axios
      //   .get(URL)
      //   .then(response => console.log(response))
      //   .catch(err => console.log(err));

      async function getData() {
        try {
          return await axios.get(URL);
        } catch (error) {
          console.error(error);
        }
      }
      getData().then(data => console.log(data));
    </script>
  </body>
</html>
